<template>
  <div>
    <!-- 面包屑 -->
    <el-bread></el-bread>
    <!-- 添加按钮 -->
    <el-button @click="tjadd" class="butadd" type="primary" size="small" plain
      >添加</el-button
    >
    <!-- 列表 -->
    <v-list @edit="edit"></v-list>
    <!-- 分页组件 -->

    <!-- 弹框 -->
    <v-dialog @cancel="cancel" ref="dailog" :addInfo="addInfo"></v-dialog>
  </div>
</template>
    
    <script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
      addInfo: {
        flag: false,
        isAdd: true,
      },
    };
  },
  components: {
    vList,
    vDialog,
  },
  methods: {
    //点击添加
    tjadd() {
      this.addInfo.flag = true;
      this.addInfo.isAdd = true;
    },
    //自定义事件
    cancel(e) {
      this.addInfo.flag = e;
    },
    edit(e) {
      //打开弹框
      this.addInfo.flag = true;
      //控制显示隐藏
      this.addInfo.isAdd = false;
      this.$refs.dailog.lookup(e);
    },
  },
};
</script>
    
<style lang="less" scoped>
.butadd{
  margin: 10px 5px;
}
</style>